package java67_adv8;

public class Thread2 implements Runnable {
	private String name;

	public Thread2(String n) {
		name = n;
	}

	@Override
	public void run() {
		for (int i = 1; i <= 20; i++) {
			System.out.println(name + " print " + i);
		}
	}

	public static void main(String[] args) {
		for (int i = 1; i <= 4; i++) {
			Thread2 th = new Thread2("线程" + i);
			Thread t = new Thread(th);
			t.start();
		}
		System.out.println("主线程的名字:" + Thread.currentThread().getName());
	}
}
